<?php if(null === $this->group || empty($this->group)): ?>
	<div class="head">Ошибка</div>
	<div class="cont_body" style="padding: 10px">
		Не указана группа.
		
		<div class="clear"></div>
	</div>
<?php else: ?>
	<a onClick="$('.cont_body').show();">>_<</a>
	<div class="head"><div class="title">Настройка группы</div></div>
	<div class="cont_body" >
		<div class="info-group">			
			<div class="row-fluid">
			  <div class="span3">
			    <img src="<?php echo $this->group->photo_medium ?>" />
			  </div>
			  <div class="span4">
					<h1><?php echo $this->group->name ?></h1>
					<a href="http://vk.com/<?php echo $this->group->url ?>" target="_blank">Перейти в группу</a>
				</div>
			</div>
		</div>
		<div class="box-header">
			<div class="box-title">Detected spam</div>
		</div>
		<div>
			<?php
				foreach ($this->spams as $spam) {
					echo "<p><a href='{$spam->getPostUrl()}'>{$spam->getPostUrl()}</a> <br />";
					echo "{$spam->getText()}</p><br /><br />";
				}
			?>
		</div>
		<div class="box-header">
		  <div class="box-title">Настройка водяного знака</div>
		</div>
		<form class="form-horizontal" id="watermark" action="/group/watermark.upload?id=<?php echo $this->group->vk_id; ?>"  method="post" enctype="multipart/form-data">
		    <div class="control-group">
		    	<?php if($this->watermark != 'none'): ?>
		      		<div class="watermark-prev"><img src="<?php echo $this->watermark . '?_t=' . time() ?>" /></div>
		        <?php endif; ?>
		      <label class="control-label" for="input01">Загрузите Watermark</label>
		      <div class="controls">
		        <input class="input-file" id="fileInput" type="file" accept="image/*" name="filename">
		      </div>
		    </div>
		    <div class="box-controls-wrap">
		    	<div class="box-controls">
		    		<div class="pull-right">
		    			<button data-loading-text="<img src='/images/loader_btn.gif'/>" class="btn-primary" id="watermark-save">Сохранить</button>
		    		</div>
    			</div>
    		</div>
		</form>
	<div class="clear"></div></div>
<?php endif; ?>
<script>
var btn_watermark_save = $('#watermark-save');
btn_watermark_save.click(function(){
	$(this).button('loading');
	$('#watermark').submit();
	return false;
});

$(".cont_body").show();
</script>
